package com.coolingme.f02_factorymethod;

import com.coolingme.f02_factorymethod.factory.JavaCourseFactory;
import com.coolingme.f02_factorymethod.factory.PythonCourseFactory;

/**
 * 工厂方法模式测试
 *
 * @author wangyue
 * @date 2020/9/17 9:29
 */
public class FactoryMethodTest {

    public static void main(String[] args) {
        JavaCourseFactory javaCourseFactory = new JavaCourseFactory();
        ICourse javaCourse = javaCourseFactory.create();

        PythonCourseFactory pythonCourseFactory = new PythonCourseFactory();
        ICourse pythonCourse = pythonCourseFactory.create();

        javaCourse.learn();
        pythonCourse.learn();
    }
}
